package structureType.decorator.stream;

import java.util.*;

public abstract class MStream {
	private List<Object> streamList = new ArrayList<Object>();
	private int maxSize = 10;
	public void putInt(int i){
		if(streamList.size() > maxSize){
			System.out.println("Sorry.....run handleBufferFull");
		}else{
			streamList.add(new Integer(i));
		}
	}
	public void putString(String str){
		if(streamList.size() > maxSize){
			System.out.println("Sorry.....run handleBufferFull");
		}else{
			streamList.add(str);
		}
	}
	public Object pull(){
		Object o = streamList.remove(streamList.size()-1);
		return o;
	}
	public abstract void HandleBufferFull();
}
